﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Optimus
{
    class Desktop
    {
        //VGA is extremely slow
        public static void DrawDesktop()
        {
                NovaDraw2D.DrawFillRectangle(0, 0, (uint)VGA.ScreenWidth, (uint)VGA.ScreenHeight, 0);//Black
                NovaDraw2D.DrawFillRectangle(0, (uint)VGA.ScreenHeight - 20, (uint)VGA.ScreenWidth, 20, 4);//TaskBar

                NovaDraw2D.DrawFillRectangle((uint)VGA.ScreenWidth - 30, 0, 30, 20, 4);//Timer
                NovaDraw2D.DrawRectangle((uint)VGA.ScreenWidth - 30, 0, 30, 20, 8);//Outline

                //320
                NovaDraw2D.DrawFillRectangle(110, 210, 100, 60, 4);//TaskBar
                NovaDraw2D.DrawRectangle(110, 210, 100, 60, 8);//Outline

                Kbd.Textx = 134;
                Kbd.Texty = 240;
                Kbd.Color = 8;
                Kbd.WriteText("WELCOME");

                NovaDraw2D.DrawScreen();
            
            Mouse.Initialize();
            int a = 0, b = 0;
            while (true)
            {
               /* NovaDraw2D.DrawFillRectangle(0, 0, (uint)VGA.ScreenWidth, (uint)VGA.ScreenHeight, 0);//Black
                NovaDraw2D.DrawFillRectangle(0, (uint)VGA.ScreenHeight - 20, (uint)VGA.ScreenWidth, 20, 4);//TaskBar

                NovaDraw2D.DrawFillRectangle((uint)VGA.ScreenWidth - 30, 0, 30, 20, 4);//Timer
                NovaDraw2D.DrawRectangle((uint)VGA.ScreenWidth - 30, 0, 30, 20, 8);//Outline

                //320
                NovaDraw2D.DrawFillRectangle(110, 210, 100, 60, 4);//TaskBar
                NovaDraw2D.DrawRectangle(110, 210, 100, 60, 8);//Outline*/

                Kbd.Textx = 134;
                Kbd.Texty = 240;
                Kbd.Color = 8;
                Kbd.WriteText("WELCOME");

              
                NovaDraw2D.DrawTextCharEx((uint)Mouse.X, (uint)Mouse.Y, Font8x8.Mouse,8);
                if (Mouse.X != a | Mouse.Y != b)
                {
                    NovaDraw2D.DrawScreen();
                    a = Mouse.X;
                    b = Mouse.Y;
                }
            }

        }
 
    }
}
